package com.shqcjd.yunweiyanoperator.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.yunweiyanoperator.R;
import com.shqcjd.yunweiyanoperator.model.pojo.CollectionBean;
import com.shqcjd.yunweiyanoperator.model.pojo.ShareBean;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ShareAdapter extends BaseQuickAdapter<ShareBean.ListBean, ShareAdapter.ViewHolder> {
    private Context context;

    public ShareAdapter(@Nullable List<ShareBean.ListBean> data, Context context) {
        super(R.layout.item_share, data);
        this.context = context;
    }

    @Override
    protected void convert(ViewHolder helper, ShareBean.ListBean item) {
        helper.tvShareTitle.setText(item.title);
        helper.tvShareName.setText(item.userName);
        helper.tvShareTime.setText(item.createTime);
        helper.tvShareUp.setText("点赞数:"+item.likeNum);
        helper.tvShareCollection.setText("收藏数:"+item.collectNum);
    }

    class ViewHolder extends BaseViewHolder {
        @BindView(R.id.tv_share_title)
        TextView tvShareTitle;
        @BindView(R.id.tv_share_name)
        TextView tvShareName;
        @BindView(R.id.tv_share_time)
        TextView tvShareTime;
        @BindView(R.id.tv_share_up)
        TextView tvShareUp;
        @BindView(R.id.tv_share_collection)
        TextView tvShareCollection;
        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
